#include <cstdio>
#include <vector>

const int N = 1e6 + 10;

int n, m;

/**
 * 
 * 时间复杂度：O(n*m)
 * 空间复杂度：O(n*m)
 * 
 * 蚂蚁军团
 * @return 
 */
int main() {
    scanf("%d %d", &n, &m);
    std::vector<std::vector<int>> v(n, std::vector<int>(m, 0));
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            scanf("%d", &v[i][j]);
        }
    }
    for (int i = 0; i < m; ++i) {
        int ans = 0;
        int lastVal = v[n - 1][i];
        for (int j = 0; j < n; ++j) {
            if (v[j][i] == lastVal) {
                ++ans;
            }
        }
        printf("%d ", ans);
    }
    return 0;
}